<template>
    <el-menu :default-active="$route.path" class="el-menu-demo" mode="horizontal" @select="handleSelect">
      <el-menu-item index="/">添加菜品</el-menu-item>
      <el-menu-item index="/dishes">查看菜品</el-menu-item>
      <el-menu-item index="/rate">评分菜品</el-menu-item>
    </el-menu>
  </template>
  
  <script>
  export default {
    methods: {
      handleSelect(key, keyPath) {
        this.$router.push(key);
      }
    }
  };
  </script>
  
  <style scoped>
  .el-menu-demo {
    line-height: 60px;
  }
  </style>